package com.designpattern.template.java8;

import java.math.BigDecimal;
import java.util.function.Consumer;
import java.util.function.Supplier;

public class AbstractBusinessHandler {

    /**
     * 模板方法
     */
    protected void execute(Supplier<String> supplier, Consumer<BigDecimal> consumer) {
        String number = supplier.get();
        System.out.println(number);
        if (number.startsWith("vip")) {
            //Vip号分配到VIP柜台
            System.out.println("Assign To Vip Counter");
        } else if (number.startsWith("reservation")) {
            //预约号分配到专属客户经理
            System.out.println("Assign To Exclusive Customer Manager");
        } else {
            //默认分配到普通柜台
            System.out.println("Assign To Usual Manager");
        }
        consumer.accept(null);
        judge();
    }

    /**
     * 功能描述: 评价
     * @param
     * @return void
     */
    private void judge(){
        System.out.println("给个好评");
    }
}
